import { Controller, Get, Param, Query } from '@nestjs/common';
import { AppService } from './app.service';

@Controller()
export class AppController {
  constructor(private readonly appService: AppService) {}

  @Get()
  getHello(): string {
    return this.appService.getHello();
  }
  // 如何获取get的query参数和parma参数
  @Get('getQueryAndParam/:id')
  getQuery(
    @Param('id') params: string,
    @Query() query: { value: number; qx: number },
  ): any {
    // 实际上你可以直接通过req去拿，当然通过注入也是可以的
    console.log('params', params);
    console.log('query', query);
    return '2222';
  }
}
